<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>usb: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">usb
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">usb Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This file contains the implementation of the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> component. It is the driver for the USB device controller.</p>
<p>The USB device controller supports the following features:</p><ul>
<li>USB 2.0 Specification supporting High/Full/Low Speed</li>
<li>8 Endpoints<ul>
<li>1 Control Endpoint</li>
<li>7 Configurable Endpoints, which can be configured as IN or OUT , and configurable as Interrupt or Bulk or Isochronous</li>
</ul>
</li>
<li>2 Ping Pong Buffers for all the endpoints except the Control Endpoint</li>
</ul>
<p><b>Initialization &amp; Configuration</b></p>
<p>The device driver enables higher layer software (e.g., an application) to communicate to the USB device. Apart from transmission and reception of USB frames the driver also handles the configuration of the device. A single device driver can support multiple USB devices.</p>
<p><a class="el" href="group__usb__v5__0.html#ga05f262f5c35f642fefc16b7912086265" title="This function initializes a XUsb instance/driver. ">XUsb_CfgInitialize()</a> API is used to initialize the USB device. The user needs to first call the <a class="el" href="group__usb__v5__0.html#ga833556c2bbb9beb055873006fea7b2ed" title="Looks up the device configuration based on the unique device ID. ">XUsb_LookupConfig()</a> API which returns the Configuration structure pointer which is passed as a parameter to the <a class="el" href="group__usb__v5__0.html#ga05f262f5c35f642fefc16b7912086265" title="This function initializes a XUsb instance/driver. ">XUsb_CfgInitialize()</a> API.</p>
<ul>
<li>Configuration of the DEVICE endpoints: The endpoints of the device need to be configured using the <a class="el" href="group__usb__v5__0.html#ga265f540fba1a12b0e310052d4cfa5a2d" title="This function configures a specific end point with the given configuration data. ">XUsb_EpConfigure()</a> function call. After configuration is complete, the endpoints need to be initialized using the XUsb_EpInitializeAll() function call.</li>
</ul>
<p><b> PHY Communication </b></p>
<p>As the H/W doesn't give any provision for the driver to configure the PHY, the driver doesn't provide any mechanism for directly programming the PHY.</p>
<p><b> DMA </b></p>
<p>The USB device has an inbuilt DMA. It's a simple DMA for data transfer between endpoint buffer memory and the external memory. The driver has two APIs for DMA operation. one API is used for resetting the DMA module of the USB device. The other API is for initiating the DMA transfer. The DMA transfer API is internal to the driver and is used by the USB endpoint data send and data receive functions. Upon completion of DMA transfer the USB device sets the buffer ready bit of the endpoint for which the DMA transfer is initiated. Setting of the buffer ready bit enables transmission/reception of an endpoint data. To enable the USB device to know to which endpoint the current DMA transfer is initiated, the driver writes the buffer ready mask to the DMA control register.</p>
<p>The DMA in the device can be enabled or disabled only during the system build time.</p>
<p><b> Interrupts </b></p>
<p>The driver provides an interrupt handler XUsb_IntrHandler for handling the interrupt from the USB device. The users of this driver have to register this handler with the interrupt system and provide the callback functions. The interrupt handlers and associated callback functions for the USB device have to be registered by the user using the <a class="el" href="group__usb__v5__0.html#gada7caf770f82936ab7493b67d143b9a9" title="This function installs an asynchronous callback function for the general interrupt (interrupts other ...">XUsb_IntrSetHandler()</a> function and/or <a class="el" href="group__usb__v5__0.html#gae7fef0669e6d6094cc2af067195cc04d" title="This function sets the handler for endpoint events. ">XUsb_EpSetHandler()</a> function.</p>
<p><a class="el" href="group__usb__v5__0.html#gada7caf770f82936ab7493b67d143b9a9" title="This function installs an asynchronous callback function for the general interrupt (interrupts other ...">XUsb_IntrSetHandler()</a> function installs an asynchronous callback function for the general interrupts (interrupts other than the endpoint interrupts).</p>
<p><a class="el" href="group__usb__v5__0.html#gae7fef0669e6d6094cc2af067195cc04d" title="This function sets the handler for endpoint events. ">XUsb_EpSetHandler()</a> function installs the callback functions for the interrupts related to the endpoint events. A separate callback function has to be installed for each of the endpoints.</p>
<p><b> Virtual Memory </b></p>
<p>This driver supports Virtual Memory. The RTOS is responsible for calculating the correct device base address in Virtual Memory space.</p>
<p><b> Threads </b></p>
<p>This driver is not thread safe. Any needs for threads or thread mutual exclusion must be satisfied by the layer above this driver.</p>
<p><b> Asserts </b></p>
<p>Asserts are used within all Xilinx drivers to enforce constraints on argument values. Asserts can be turned off on a system-wide basis by defining, at compile time, the NDEBUG identifier. By default, asserts are turned on and it is recommended that users leave asserts on during development.</p>
<p><b> Building the driver </b></p>
<p>The <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
----- ---- -------- ---------------------------------------------------------
1.00a hvm  02/22/07 First release.
1.01a hvm  05/30/07 The chapter 9 files are moved to examples directory.
1.01a sdm  08/22/08 Removed support for static interrupt handlers from the MDD
		file
1.01a hvm  10/02/08 The Buffer0Ready, Buffer1Ready are declared as volatile.
		In function XUsb_EpDataRecv, the initialization of
		Buffer0Ready, Buffer1Ready and CurBufNum variables is
		moved before the buffer ready bit is set in the buffer
		ready register.
		Added the initialization of Buffer0Ready, Buffer1Ready
		and CurBufNum variables in the XUsb_EpDataSecd function.
2.00a	hvm  10/22/08 Added Support for the new XPS USB device. The new
		device has support for DMA. Apart from the
		DMA, remote wakeup feature is also added the USB device.
			However, there is no additional code needed to be added
		in the driver to support this feature.
3.00a hvm  12/03/09 Added the modifications related to the new USB error
		reporting register in the XPS USB device. Updated to use
		HAL processor APIs. Removed _m from the	name of the
		macros.
		XUsb_mReadReg is renamed to XUsb_ReadReg and
		XUsb_mWriteReg is renamed to XUsb_WriteReg.
3.01a hvm  5/20/10  Updated with fix for CR561171.The interrupt handler is
		updated to call the error handler callback function
			during error interrupts.
3.02a hvm  7/15/10  Added Device ID initialization in XUsb_CfgInitialize
		function (CR555996).
3.02a hvm  8/5/10   Updated the XUsb_EpDataRecv function to ensure that the
		buffer ready bit setup is now made only during non-DMA
		case. CR570776.
3.02a hvm  8/16/10  Updated the examples with the little endian support.
4.00a hvm  10/21/10 Added new API XUsb_DmaIntrSetHandler for setting up DMA
		handler. Updated the XUsb_IntrHandler function to call
		the DMA handler to handle DMA events. Removed DmaDone
		and DmaError variables from the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> structure.
		Added two new APIs to provide access to the new ULPI PHY
		register.
4.01a hvm  8/23/11  Added new bit definitions for isochronous transfer bits
		in endpoint configuration register. Added a new API
		for setting these bits for a given endpoint. These bits
		are available only in the newer versions of the AXI USB
		IP. Check the IP datasheet for more details.
4.02a bss  3/04/12  Modified XCOMPONENT_IS_READY to XIL_COMPONENT_IS_READY
		CR 650877
4.03a bss  06/20/10 Added SIE Reset API to reset (XUsb_SieReset) the SIE
	      state machine in <a class="el" href="xusb_8c.html">xusb.c</a> and SIE Reset Mask in <a class="el" href="xusb__l_8h.html">xusb_l.h</a>
	      for CR 660602
4.04a bss  10/22/13 Added macros for HSIC PHY registers in <a class="el" href="xusb__l_8h.html">xusb_l.h</a>.
5.0   adk  19/12/13 Updated as per the New Tcl API's</pre><pre></pre> </div></div><!-- contents -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
